import axios from '@/libs/api.request'

export const getTableData = (parmas) => {
  return axios.request({
    url: 'admin/doc/docinfo/get',
    method: 'post',
    data: parmas
  })
}
export const deleteData = (id) => {
  return axios.request({
    url: `/admin/doc/docinfo/delele/${id}`,
    method: 'post'
  })
}
export const getDocAttributes = () => {
  return axios.request({
    url: `/admin/doc/attributes/get`,
    method: 'get'
  })
}
// 收文号
export const getDocAttributesNumber = (query) => {
  return axios.request({
    url: `/admin/doc/docinfo/docno/get?docAttributes=${query}`,
    method: 'get'
  })
}
export const getHostUnitName = () => {
  return axios.request({
    url: `/admin/unit/get`,
    method: 'get'
  })
}
export const getSecretName = () => {
  return axios.request({
    url: `/admin/doc/secret/get`,
    method: 'get'
  })
}
// 收文
export const addContent = (parmas) => {
  return axios.request({
    url: `/admin/doc/docinfo/save`,
    method: 'post',
    data: parmas
  })
}
export const getDragList = () => {
  return axios.request({
    url: 'get_drag_list',
    method: 'get'
  })
}

export const errorReq = () => {
  return axios.request({
    url: 'error_url',
    method: 'post'
  })
}

export const saveErrorLogger = (info) => {
  return axios.request({
    url: 'save_error_logger',
    data: info,
    method: 'post'
  })
}

export const uploadImg = (formData) => {
  return axios.request({
    url: 'image/upload',
    data: formData
  })
}

export const getOrgData = () => {
  return axios.request({
    url: 'get_org_data',
    method: 'get'
  })
}

export const getTreeSelectData = () => {
  return axios.request({
    url: 'get_tree_select_data',
    method: 'get'
  })
}
